%h1 
  User List for Site:
  = "#{@site.name}, #{@site.country.name}"

= content_tag(:div, flash[:notice], :class => "notice") if flash[:notice]!=nil

.menu
  = link_to '[Log out]', :controller => 'login', :action => 'index'

.new-box
  - form_for :user, nil, :url => {:action => 'add'} do |f|
    %b Add Individual User.
    Name (first last):
    = f.text_field :name
    = submit_tag "Add"
  - form_tag({:action => 'upload'}, :multipart => true) do |f|
    %b Upload User List:
    = file_field_tag :file
    = submit_tag "Upload"

%h2 Current users

%small
  %b Notes.
  The logins are automatically generated.  
  - if PREFIX_LEVEL == :country
    The running numbers are shared among contestants from the same country.
    The country manager can rerun the numbers later.
  - else
    The running numbers are shared among contestants from the same site.

%table.list
  %tr.header
    %th
    %th Login
    %th Name
    %th Password
    %th
  - counter = 0
  - @users.each do |user|
    %tr
      %td= counter+1
      %td.name=h user.login
      %td.name=h user.name
      %td.passwd
        %tt=h user.password
      %td
        = link_to '[edit]', :action => 'edit', :id => user.id
        = link_to '[delete]', :action => 'delete', :id => user.id
    - counter += 1
